Processor systems typically include a variety of memory types. For example, processor systems are often provided with non-volatile memories such as magnetic data storage devices, optical data storage devices, solid-state data storage devices, etc. Flash memory is a particular type of non-volatile memory that a processor system can use to store data for a plurality of purposes. Processor systems may use flash memory devices to store program code and data associated with hardware device drivers, operating systems, applications, etc. Flash memory may also be used to implement mass data storage devices (e.g., removable media cards, on-board media storage, etc.).
Flash memory access operations function differently from memory access operations typically used to access other forms of memory such as volatile random access memory (RAM). For example, write operations used to change contents of RAM may be performed relatively quickly by specifying the write operation, a target address, and data to be written. A processor executes the RAM write operation by selecting the specified address and setting the bits in the data space corresponding to that address with the provided data. Changing contents in a RAM type of memory may be done, for example, by changing a bit from ‘0’ to ‘1’ or from ‘1’ to ‘0’ depending on the previous contents of the data space and the data to be written to the data space.
Writing data to flash memory devices involves a different process from that used to write data to RAM memory devices. Specifically, flash memory devices require erasing invalid contents of a data space (e.g., setting all bits to ‘1’) or contents of a data space previously indicated as deleted before writing data into the data space. Flash memory devices are typically organized into blocks of memory (e.g., 64 k-byte blocks). Erase operations require erasing an entire block of memory, regardless of the amount of memory within that block to which a program (e.g., an operating system, an application, etc.) or user intends to write. Prior to erasing a block of memory, valid data therein is preserved by storing it in a different block of memory.
To decrease the amount of time required to perform a write operation in flash memories, processor systems often periodically or aperiodically execute erase operations to recover or reclaim data space containing data previously indicated by an application as invalid (e.g., a file deleted by a user). The reclaimed data space is then indicated as writeable so that any subsequent write operation can write to the reclaimed data space without first requiring execution of an erase operation.